package com.ac.app.web.action.org;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ac.app.dm.PickOrg;
import com.ac.app.web.form.PickOrgForm;
import com.caac.core.dm.User;
import com.caac.core.web.action.BaseAction;
import com.caac.core.web.form.BaseForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;


public class SavePickOrgAction extends BaseAction {
    protected ActionForward doExecute(ActionMapping mapping,
                                      BaseForm form,
                                      HttpServletRequest request,
                                      HttpServletResponse response)
            throws Exception {
    	User user =this.getUserFromCache(request, response);
    	PickOrgForm myForm=(PickOrgForm)form;
    	PickOrg dm=myForm.getDm();
    	if(dm.getId()==null){
    		dm.setCreator(user.getId());
    		dm.setCrtTime(new Date());
    	}
    	dm.setUpdater(user.getId());
    	dm.setUptTime(new Date());
    	this.getBaseManager().saveObject(dm);
        return forward(mapping);
    }
}
